package ru.arriah.common.ejb;

import java.rmi.*;
import javax.ejb.*;
import ru.arriah.common.ejb.help.*;

public abstract class Sequence extends GenericEntityBean {
   public Sequence() {
      super();
   }

   public void setEntityContext(
      EntityContext entityContext
   ) throws EJBException, RemoteException {
   }

   public abstract String getName();
   public abstract void setName(String name);
   public abstract int getValue();
   public abstract void setValue(int value);

   public KeyBlock getNextBlock(int size) {
      int currentKey = getValue();
      int margin = currentKey + size;
      setValue(margin);
      return new KeyBlock(currentKey, margin);
   }
}
